#include <SDL.h>

void process_events()
{
     SDL_Event message;

     while (SDL_PollEvent(&message)) {

          switch (message.type) {

          case SDL_QUIT:
			SDL_Quit();
			exit(0);
               break;
          }
     }
}

int main(int argc, char * argv[])
{
     SDL_Init(SDL_INIT_VIDEO);
     const SDL_VideoInfo* info = SDL_GetVideoInfo();

     int bpp = info->vfmt->BitsPerPixel;
     Uint32 flags = 0;

     SDL_SetVideoMode(640, 480, bpp, flags);
     SDL_WM_SetCaption("Hello world", 0);

	for (;;) {

		process_events();
	}

	return 0;
}
